<!DOCTYPE html>
<html>
<head>
	<title></title>
</head>
<body>

<script type="text/javascript">
	
var a = [];
for (var i = 0; i < 10; i++) {
	a[i] = function () {
		console.error(i);
	}
}
a[6]();

</script>

</body>
</html>